<?php
    $event = $this->event;
    $participant = $this->participant;
    $participated_events=$this->participated_events;
?>
    <div class="row">
        &nbsp;
    </div>
	<div class="row">
		<div class="col-md-12">
			<div class="panel panel-default">
				<div class="panel-heading">
					<h3 class="panel-title">Profile</h3>
				</div>

				<div class="panel-body">
				
				    <div class="form-group">
						<div class="col-md-2 control-label">Name:</div>
						<div class="col-md-10">
						     <?php  if($this->escapeHtml($participant->TITLE)==1){
    				                    $title="Rev";
    				                }
    				                else if($this->escapeHtml($participant->TITLE)==2){
    				                    $title="Ps";
    				                }
    				                else if($this->escapeHtml($participant->TITLE)==3){
    				                    $title="Mr";
    				                }
    				                else if($this->escapeHtml($participant->TITLE)==4){
    				                    $title="Mrs";
    				                }
    				                else if($this->escapeHtml($participant->TITLE)==5){
    				                    $title="Miss";
    				                }
    				                else if($this->escapeHtml($participant->TITLE)==6){
    				                    $title="Dr";
    				                }
    				                else if($this->escapeHtml($participant->TITLE)==7){
    				                    $title="Prof";
    				                }
    				                else if($this->escapeHtml($participant->TITLE)==8){
    				                    $title="";
    				                }
    				        ?>
                            <?php  echo $title." ".$participant->FIRST_NAME." ".$participant->LAST_NAME; ?>
                        </div>
					</div>
					
					<div class="form-group">
						<div class="col-md-2 control-label">Gender:</div>
						<div class="col-md-10">
						    <?php 
				                    $gender="";
            			            if($this->escapeHtml($participant->GENDER)==1){
            			                $gender="Male";
            			            }
            			            else if($this->escapeHtml($participant->GENDER)==2){
            			                $gender="Female";
            			            }
        			        ?>
                            <?php   echo $gender; ?>
                        </div>
					</div>
					
					<div class="form-group">
						<div class="col-md-2 control-label">Address:</div>
						<div class="col-md-10">
						     <?php echo $participant->ADDRESS;?>
                        </div>
					</div>
					
				</div>
			</div>
		</div>
		
		<div class="col-md-12">
			<div class="panel panel-default">
				<div class="panel-heading">
					<h3 class="panel-title">Event Participated</h3>
				</div>

				<div class="panel-body">
				    <div class="table-responsive">
		              <table class="table table-bordered table-striped">
            				<tr>
            				    <th>No</th>
            					<th>Event ID</th>
            					<th>Date</th>
            					<th>Title</th>
            					<th>Place</th>
            					<th>Category</th>
            					<th>Funding</th>
            					<th>Organization</th>
            				</tr>
            				<?php $no=1 ?>
            				<?php foreach ($participated_events as $event) : ?>
            				<tr>       	
            				            <td><?php echo $no++ ?>
            				            <td><?php echo $this->escapeHtml($event->TITLE);?></td>		
                    			        <td><?php echo $this->escapeHtml($event->DATE);?>
                    			        <td><?php echo $this->escapeHtml($event->TITLE);?></td>
                    					<td><?php echo $this->escapeHtml($event->PLACE);?></td>
                    					<td><?php                         					
                            					if($this->escapeHtml($event->CATEGORY)==1){
                            						echo "Main";
                            					}
                            					else if($this->escapeHtml($event->CATEGORY)==2){
                            						echo "District";
                            					}
                            					else if($this->escapeHtml($event->CATEGORY)==3){
                            						echo "Regional";
                            					}
                        					?>
                        				</td>
                    					<td><?php 
                        			            if($this->escapeHtml($participant->FUNDING)==1){
                        			                echo "Self";
                        			            }
                        			            else if($this->escapeHtml($participant->FUNDING)==2){
                        			                echo "By Organaization";
                        			            }
                        			        ?>
                        			    </td>
                    					<td><?php echo $this->escapeHtml($participant->ORGANIZATION);?></td>	        			
                    		</tr>
                    		<?php endforeach; ?>
            		  </table>
		
	               </div>				    
				</div>
			</div>
		</div>
				
	</div>
